<ion-header>
  <ion-navbar>
    <ion-title>收费记录</ion-title>
    <ion-buttons end>
      <button ion-button icon-only (click)="presentPopover($event)">
        <ion-icon name="more"></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>

<ion-content>
  <ion-list>

    <ion-item class="w06">
      <ion-label>日期始:</ion-label>
      <ion-datetime displayFormat="YYYY-MM-DD" pickerFormat="YYYY-MM-DD" doneText="确定" cancelText="取消"  max="{{max}}"
                    [(ngModel)]="timeStarts" (ngModelChange)="timeQuery()"></ion-datetime>
    </ion-item>

    <ion-item class="w06">
      <ion-label>日期止:</ion-label>
      <ion-datetime displayFormat="YYYY-MM-DD" pickerFormat="YYYY-MM-DD" doneText="确定" cancelText="取消"  max="{{max}}"
                    [(ngModel)]="timeEnds" (ngModelChange)="timeQuery()"></ion-datetime>
    </ion-item>

    <ng-container *ngFor="let data of datas">
      <ion-item class="mt15" (click)="showMaterial(data)">
        <ion-label class="text_hide_none">
          <span class="w08"><span class="font_gray" >单号：</span>{{data.SORDER_ID}}</span>
          <span class="w08"><span class="font_gray" >客户姓名：</span>{{data.KHMC}}</span>
            <span class="w08"><span class="font_gray" >联系电话：</span>{{data.MOBILE}}</span>
            <span class="w08"><span class="font_gray" >联系地址：</span>{{data.KHDZ}}</span>
          <span class="w08 mt5 "><span class="font_gray">完工时间：</span>{{data.SORDER_TIME}}</span>
          <ng-container *ngIf="data.show||false">
            <ng-container *ngFor="let fylb of data.FYLB">
              <div class="w12">
                <span class="tl">{{fylb.AMOUNT_NAME}}</span>
                <span class="tr fr font_gray">× {{fylb.NUM}}</span>
                <span class="tr fr font_red">{{fylb.PRICE|money}}</span>
              </div>
            </ng-container>
            <span class="w06">合计：{{data.FYLB[0]['KHHZJE']}}</span>
          </ng-container>
        </ion-label>
      </ion-item>
      <!--<ion-item *ngFor="let product of data.SPLB">
        <ion-label class="mt10 mb10 text_hide_none">
          <span class="w10">{{product.PRODUCT_NAME}}</span>
          <span class="w02 tr font_gray">× {{product.NUM}}</span>
        </ion-label>
      </ion-item>-->
      <!--<div class="jl_line"></div>-->
    </ng-container>
  </ion-list>
  <div *ngIf="datasConfig.isEnd==true" class="w12 mt20 mb20 tc font_gray">------------------------ 已经到底了
    ------------------------
  </div>
  <ion-infinite-scroll (ionInfinite)="getMoreDatas($event)" threshold="100px" [enabled]="!datasConfig.isEnd">
    <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="数据加载中...">
    </ion-infinite-scroll-content>
  </ion-infinite-scroll>
</ion-content>
